package com.cowin.inf.controller;

import com.cowin.base.result.Result;
import com.cowin.base.result.ResultGenerator;
import com.cowin.base.BaseController;
import com.cowin.inf.model.KyLineStateInfo;
import com.cowin.inf.model.vo.KyLineStateInfoVo;
import com.cowin.inf.service.KyLineStateInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by  on 2019/09/19.
 *
 * @author CodeGenerator
 */
@Slf4j
@Api(value = "KyLineStateInfoController", description = "产线状态明细控制器", tags = "KyLineStateInfoController", consumes = "application/json")
@RestController
@RequestMapping("/ky/line/state/info")
public class KyLineStateInfoController extends BaseController<KyLineStateInfo> {
    @Resource
    private KyLineStateInfoService kyLineStateInfoService;

    @ApiOperation(value = "停线记录查询", notes = "停线记录查询")
    @PostMapping("/filter")
    public Result filter(@RequestBody KyLineStateInfoVo kyLineStateInfoVo){
        PageHelper.startPage(kyLineStateInfoVo.getPage(), kyLineStateInfoVo.getLimit());
       List<KyLineStateInfoVo> list= kyLineStateInfoService.filter(kyLineStateInfoVo);
        PageInfo<KyLineStateInfoVo> pageInfo = new PageInfo<>(list);
        return ResultGenerator.genSuccessResult(pageInfo);
    }
}
